
cc.Class({
    extends: cc.Component,

    properties: {
        
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
        ResMgr.LoadRes("cocos", cc.Prefab, null);
        ResMgr.LoadRes("cocos", cc.Prefab, function(err,path){
            if (err==null) {
                let p = ResMgr.GetInstance("cocos");
                if (p) {
                    cc.find("Canvas").addChild(p);
                }
            }
        });
        ResMgr.LoadRes("cocos2", cc.Prefab, function(err,path){
            if (err==null) {
                let p = ResMgr.GetInstance("cocos2");
                if (p) {
                    let ar = p.addComponent("AutoRelease");//可以销毁节点时自动释放资源
                    ar.resUrl = "cocos2";
                    cc.find("Canvas").addChild(p);
                }
            }
        });
    },

    // start () {
    // },

    // update (dt) {
    // },

    ReleaseP1:function () {
        ResMgr.ReleaseInstance("cocos");
    },

    DeleteP2:function () {
        cc.find("Canvas/cocos2").destroy();
    }
});
